<div class="content">
	<div class="tab_bar">
		<ul>
			<li class="tab_index" onclick="setTabContent(this);">编辑外链</li>
		</ul>
		<button class="btn_tabbar" onclick="submitActionForm(this);" return="link/list.do?currentPageNo=1">保 存</button>
	</div>
	<form id="myForm" action="link/update.do" method="post" onsubmit="return false;">
		<input type="hidden" name="id" value="${entity.id?c}" />
		<div class="tab_content">
			<div class="tab_item tab_show">
				<table class="table_for_add">
					<tbody>
					<tr class="rowBgColor">
						<th width="140">链接名称：</th>
						<td><input class="input_for_add" name="name" type="text" value="${entity.name!}" /></td>
						<td><span id="name_status"></span></td>
					</tr>
					<tr class="rowBgColor">
						<th width="140">URL地址：</th>
						<td><input class="input_for_add" name="url" type="text" value="${entity.url!}"/></td>
						<td><span></span></td>
					</tr>
					<tr>
						<th>图标：</th>
						<td><input id="channelIcon" class="input_for_add" name="icon" type="text" value="${entity.icon!}"  />
							<button onclick="uploadImage()">上传图片</button>
						</td>
						<td><span></span></td>
					</tr>
					<tr class="rowBgColor">
						<th>描述信息：</th>
						<td>
							<textarea class="textarea_for_add" name="description">${entity.description!}</textarea>
						</td>
					</tr>
					</tbody>
				</table>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">


    var _editor = UE.getEditor('upload_ue');
    _editor.ready(function () {
        console.log("ueditor success!")
        //设置编辑器不可用
        _editor.setDisabled();
        //隐藏编辑器，因为不会用到这个编辑器实例，所以要隐藏
        _editor.hide();
        //侦听图片上传
        _editor.addListener('beforeInsertImage', function (t, arg) {
            console.log(arg);
        })
        //侦听文件上传
        _editor.addListener('afterUpfile', function (t, arg) {
            console.log(arg);
            $("#channelIcon").attr("value", arg[0].src);
        })
    });

    function uploadImage(){
        var myImage = _editor.getDialog("insertimage");
        myImage.open();
    }
</script>